package homework.exp03;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;

public class F {
    static Scanner cin = null;

    static {
        try {
            cin = new Scanner(new FileReader(new File("F.in")));
        } catch (IOException e) {
            cin = new Scanner(System.in);
        }
    }

    private static int currentIndex = 0;
    private static String input;

    public static void main(String[] args) {
        while (cin.hasNextLine()) {
            input = cin.nextLine().trim();
            currentIndex = 0;
            if (isValidSentence() && currentIndex == input.length()) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
        cin.close();
    }

    private static boolean isValidSentence() {
        if (currentIndex >= input.length()) {
            return false;
        }
        char currentChar = input.charAt(currentIndex);
        currentIndex++;
        if (currentChar >= 'p' && currentChar <= 'z') {
            return true;
        } else if (currentChar == 'N') {
            return isValidSentence();
        } else if (currentChar == 'C' || currentChar == 'D' || currentChar == 'E' || currentChar == 'I') {
            return isValidSentence() && isValidSentence();
        } else {
            return false;
        }
    }
}